﻿using System;
/**
自定义输入要素检查annotation
**/
namespace open_api_sdk_csharp.com.chinaums.open.api.annotation
{
    [AttributeUsage(AttributeTargets.All)]
    public  class ApiField : Attribute
    {
        public ApiField(string key, string name, bool required, string length, string maxLength,
            string minLength, String index, String desc) : base()
        {
            this.Key = key;//key值
            this.Name = name;//变量
            this.Required = required;//是否必须
            this.Length = length;//长度
            this.MinLength = minLength;//最小长度
            this.MaxLength = maxLength;//最大长度
            this.Index = index;//序号
            this.Desc = desc;//描述
        }

        public ApiField(string name, bool required, String desc) : base()
        {
            this.Name = name;
            this.Required = required;
            this.Desc = desc;
        }
        public ApiField(string name, bool required) : base()
        {
            this.Name = name;
            this.Required = required;
        }
        public ApiField()
        {
        }
        public String Key
        {
            set; get;
        }
        public string Name
        {
            set; get;
        }
        public bool Required
        {
            set; get;
        }
        public string Length
        {
            set; get;
        }
        public string MaxLength
        {
            set; get;
        }
        public string MinLength
        {
            set; get;
        }
        public string Index
        {
            set; get;
        }
        public string Desc
        {
            set;get;
        }
    }
}
